package com.gwtplatform.samples.tab.client.contact;

import com.google.inject.Inject;

import com.guit.client.GuitPresenter;
import com.guit.client.binder.GuitBinder;
import com.guit.client.place.Place;
import com.guit.client.place.PlaceName;
import com.gwtplatform.samples.tab.client.contact.ContactPresenter.ContactBinder;
import com.gwtplatform.samples.tab.client.main.MainPresenter;

@PlaceName("contact")
public class ContactPresenter extends GuitPresenter<ContactBinder> implements Place<Void> {
    
    public static interface ContactBinder extends GuitBinder<ContactPresenter> {
    }
    
    private final MainPresenter mainPresenter;
    
    @Inject
    public ContactPresenter(MainPresenter mainPresenter) {
        this.mainPresenter = mainPresenter;
    }

    @Override
    public void go(Void data) {
        mainPresenter.setContact(getView());
    }
}
